<div id="maincontent">

<%= render :partial => "shared_common_files/data_area_help_bar" %>

<%if (params['node'] == "salesforce") %>

	<h2>Salesforce > Browse Objects > <%=params['name']%></h2>
	
	<h5>List of Records for : <%=params['name']%></h5>

	<div class="list">
		<table id="object_details">
  			<tr>
				<th><%=params['name']%> Name</th>
  			</tr>
  		
			<% count=1;%>	  
			<% rowtype="odd";%>
	
			<%for record in @records%>
	
			<%if(isodd(count))%>
				<% rowtype="odd";%>
			<%else%>
				<% rowtype="even";%>
			<%end%>  
			
			<tr class="<%=rowtype%>">
				<td><%=record%></td>
		 	</tr>
		 	
		 	<% count = count + 1 %>

			<%end%>
		</table>
	</div> 
	
<%elsif (params['node'] == "sugarcrm")%>

	<h2>SugarCRM > Browse Objects > <%=params['name']%></h2>
	
	<h5>List of Records for : <%=params['name']%></h5>

	<div class="list">
		<table id="object_details">
  			<tr>
				<th><%=params['name']%> Name</th>
				<th></th>
				<th>Action</th>
  			</tr>
  		
			<% count=1;%>	  
			<% rowtype="odd";%>
	
			<%
					
				for @recordlist in @records.entry_list
					
					for @record in @recordlist.name_value_list
					
						if(@record.name == "first_name")
							@first_name = @record.value
						end
				
						if(@record.name == "last_name")
							@last_name = @record.value
						end
			
						if(@record.name == "name")
							@name = @record.value
						end
					
						if(@record.name == "id")
							@id = @record.value
						end
			
					end
			%>
	
			<%if(isodd(count))%>
				<% rowtype="odd";%>
			<%else%>
				<% rowtype="even";%>
			<%end%>  
			
			<tr class="<%=rowtype%>">
				<td><%=@first_name%> <%=@last_name%> <%=@name%></td>
				<!-- td><a href="/integration/userdetail?node=<%=params['node']%>&name=<%=params['name']%>&record=<%=@id%>"><%=@first_name%> <%=@last_name%> <%=@name%></td -->
		 	 <td></td>
		 	 <td>
             <%if(canRequestLink("integration","userdetail"))%>
					<a href="/integration/userdetail?node=<%=params['node']%>&name=<%=params['name']%>&record=<%=@id%>"><img src='/themes/odotclassic/images/show.png' title = "Details" ></a>
			 <%end%>
             </td>
		 	
		 	</tr>
		 	
		 	<% count = count + 1 %>

			<%end%>
		</table>
	</div> 
	
<%end%>
<br/>
<div class="list">

	<table>
	     <th>Action</th>
         <tr class="even">
            <td>
            <a href="javascript:history.go(-1);"><img src="/themes/odotclassic/images/btn_cancel.gif"/></a>
              
            </td>
         </tr>  
               
	</table>

</div>  
</div>   		  